Skip to contentSkip to conversation

Change in openvpn[master]: Require script-security 2 when using unix: tun

Openvpn-devel In review plaisthos (Code Review) 2 participants 7 messages Jan 12 – Jan 13 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1768227015000.I89dcab24ba510094ce1672e382960bf15def310a@...2715...

#1 lore raw

plaisthos has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email )

Change subject: Require script-security 2 when using unix: tun
......................................................................

Require script-security 2 when using unix: tun

Since this executes an executable from an arbitrary path, it should follow the same rules as other scripts/executable.

Reported-By Petr Simecek, Pavel Kohout and Stanislav Fort from Aisle Research
Change-Id I89dcab24ba510094ce1672e382960bf15def310a

---
M src/openvpn/tun_afunix.c

1 file changed, 4 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/1465/1

src/openvpn/tun_afunix.c +4 -1
index c410480..a67a472 100644
@@ -61,7 +61,10 @@
 
     argv_printf(&argv, "%s", program);
 
-    tt->afunix.childprocess = openvpn_execve_check(&argv, env, S_NOWAITPID, msgprefix);
+    /* exit when executing fails to easier spot errors here and treat this
+     * command like an external script */
+    int flags = S_NOWAITPID | S_SCRIPT | S_FATAL;
+    tt->afunix.childprocess = openvpn_execve_check(&argv, env, flags, msgprefix);
     if (!openvpn_waitpid_check(tt->afunix.childprocess, msgprefix, M_WARN))
     {
         tt->afunix.childprocess = 0;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I89dcab24ba510094ce1672e382960bf15def310a
Gerrit-Change-Number: 1465
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email )

Change subject: Require script-security 2 when using unix: tun
......................................................................

Patch Set 1:

(1 comment)

Patchset:

PS1:
Small issue: Error message is ERROR: failure executing process for tun:: disallowed by script-security setting. There seems to be an additional :.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I89dcab24ba510094ce1672e382960bf15def310a
Gerrit-Change-Number: 1465
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-CC: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Mon, 12 Jan 2026 15:37:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email )

Change subject: Require script-security 2 when using unix: tun
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I89dcab24ba510094ce1672e382960bf15def310a
Gerrit-Change-Number: 1465
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Mon, 12 Jan 2026 15:47:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#4 lore raw

PATCH 1/1 Require script-security 2 when using unix: tun

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

Since this executes an executable from an arbitrary path, it should follow the same rules as other scripts/executable.

Reported-By Petr Simecek, Pavel Kohout and Stanislav Fort from Aisle Research
Change-Id I89dcab24ba510094ce1672e382960bf15def310a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1465
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1465
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

src/openvpn/tun_afunix.c +4 -1
index c410480..a67a472 100644
@@ -61,7 +61,10 @@
 
     argv_printf(&argv, "%s", program);
 
-    tt->afunix.childprocess = openvpn_execve_check(&argv, env, S_NOWAITPID, msgprefix);
+    /* exit when executing fails to easier spot errors here and treat this
+     * command like an external script */
+    int flags = S_NOWAITPID | S_SCRIPT | S_FATAL;
+    tt->afunix.childprocess = openvpn_execve_check(&argv, env, flags, msgprefix);
     if (!openvpn_waitpid_check(tt->afunix.childprocess, msgprefix, M_WARN))
     {
         tt->afunix.childprocess = 0;
#5 lore raw

[Openvpn-devel] [PATCH applied] Re: Require script-security 2 when using unix: tun

Change makes sense ("all external program invocations guarded by --script-security") though that's more for consistency than for actual security against "someone nasty hands you an openvpn config file and asks you to run it, unchecked, on a linux system, as root".

Tested on a t_client test set that uses --dev unix: for "ping around" tests - testing "as is" now yields:

   2026-01-13 09:34:40 WARNING: External program may not be called unless '--script-security 2' or higher is enabled. See --help text or man page for detailed info.

.. which is what we want to see. Adding that makes it work.

(I have seen the remark from Frank about the message, but that's existing code and not part of this patch - for the sake of saving time I decided to merge this "as is", we can always improve the message in a separate patch)

Your patch has been applied to the master branch.

commit 4a15d4e51ddb58fbc7a2b2369f30e51616a2a591

Author: Arne Schwabe
Date:   Tue Jan 13 08:27:45 2026 +0100
     Require script-security 2 when using unix: tun

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1465
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg35223.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#6 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: Require script-security 2 when using unix: tun
......................................................................

Require script-security 2 when using unix: tun

Since this executes an executable from an arbitrary path, it should follow the same rules as other scripts/executable.

Reported-By Petr Simecek, Pavel Kohout and Stanislav Fort from Aisle Research
Change-Id I89dcab24ba510094ce1672e382960bf15def310a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1465
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35223.html

---
M src/openvpn/tun_afunix.c

1 file changed, 4 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/1465/2

src/openvpn/tun_afunix.c +4 -1
index c410480..a67a472 100644
@@ -61,7 +61,10 @@
 
     argv_printf(&argv, "%s", program);
 
-    tt->afunix.childprocess = openvpn_execve_check(&argv, env, S_NOWAITPID, msgprefix);
+    /* exit when executing fails to easier spot errors here and treat this
+     * command like an external script */
+    int flags = S_NOWAITPID | S_SCRIPT | S_FATAL;
+    tt->afunix.childprocess = openvpn_execve_check(&argv, env, flags, msgprefix);
     if (!openvpn_waitpid_check(tt->afunix.childprocess, msgprefix, M_WARN))
     {
         tt->afunix.childprocess = 0;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I89dcab24ba510094ce1672e382960bf15def310a
Gerrit-Change-Number: 1465
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#7 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email )

Change subject: Require script-security 2 when using unix: tun
......................................................................

Require script-security 2 when using unix: tun

Since this executes an executable from an arbitrary path, it should follow the same rules as other scripts/executable.

Reported-By Petr Simecek, Pavel Kohout and Stanislav Fort from Aisle Research
Change-Id I89dcab24ba510094ce1672e382960bf15def310a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1465
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35223.html

---
M src/openvpn/tun_afunix.c

1 file changed, 4 insertions(+), 1 deletion(-)
src/openvpn/tun_afunix.c +4 -1
index c410480..a67a472 100644
@@ -61,7 +61,10 @@
 
     argv_printf(&argv, "%s", program);
 
-    tt->afunix.childprocess = openvpn_execve_check(&argv, env, S_NOWAITPID, msgprefix);
+    /* exit when executing fails to easier spot errors here and treat this
+     * command like an external script */
+    int flags = S_NOWAITPID | S_SCRIPT | S_FATAL;
+    tt->afunix.childprocess = openvpn_execve_check(&argv, env, flags, msgprefix);
     if (!openvpn_waitpid_check(tt->afunix.childprocess, msgprefix, M_WARN))
     {
         tt->afunix.childprocess = 0;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1465?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I89dcab24ba510094ce1672e382960bf15def310a
Gerrit-Change-Number: 1465
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>